<template>
  <el-drawer v-model="drawer" title="新增权限" size="50%" :before-close="handlerClose">
    <div>
      <el-button @click="innerDrawer = true">Click me!</el-button>
    </div>
  </el-drawer>
</template>

<script setup>
import { ref } from 'vue'
import { ElMessageBox } from 'element-plus'

const drawer = ref(false)
const innerDrawer = ref(false)

const handlerClose = () => {
  ElMessageBox.confirm('确定退出吗?退出就不保存了', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  })
    .then(() => {
      drawer.value = false
    })
    .catch(() => {
     
    })
}
const open = (item) => {
  drawer.value = true
}

defineExpose({
  open
})
</script>
